<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>充值规则</title>
    <link type="text/css" rel="stylesheet" href="../commons/bootstrap/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="../commons/bootstrap/table/bootstrap-table.min.css">
    <link type="text/css" rel="stylesheet" href="../commons/validate/bootstrapValidator.css">
    <link type="text/css" rel="stylesheet" href="../commons/toastr/toastr.min.css">
    <link type="text/css" rel="stylesheet" href="../commons/css/common.css">
</head>
<body>
<div class="form-groupd">
    <label for="searchName" class="label-control">规则名字</label>
    <input type="text" class="form-control" id="searchName" placeholder="规则名字">
</div>
<div class="form-groupd">
    <label for="searchStartTime" class="label-control">时间范围</label>
    <input type="text" class="form-control" id="searchStartTime" placeholder="开始时间"> -
    <input type="text" class="form-control" id="searchEndTime" placeholder="结束时间">
</div>
<div class="form-groupd">
    <label for="searchName" class="label-control">规则状态</label>
    <select class="form-control" id="searchStatus">
        <option value="-1">全部</option>
        <option value="0">禁用</option>
        <option value="1">启用</option>
    </select>
</div>
<button type="button" class="btn btn-primary" onclick="rechargeManager.search()">搜索</button>
<button type="button" class="btn btn-primary" onclick="rechargeManager.add()">新增规则</button>
<div class="tab-pane">
    <table class="table table-bordered table-striped" id="rechargeRuleList">
        <thead style="background-color: #BEDDFA">

        </thead>
    </table>
</div>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    修改规则信息
                </h4>
            </div>
            <div class="modal-body">
                <form id="ruleForm">
                    <div class="row">
                        <div class="col-md-4" hidden>
                            <div class="form-group input-group">
                                <span class="input-group-addon">编号</span>
                                <input class="form-control" placeholder="编号" name="ruleId" id="ruleId">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-8">
                            <div class="form-group input-group">
                                <span class="input-group-addon">规则名字</span>
                                <input class="form-control" placeholder="规则名字" name="ruleName" id="ruleName">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group input-group">
                                <span class="input-group-addon">起充金额</span>
                                <input class="form-control" placeholder="起充金额" name="ruleAmount" id="ruleAmount">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group input-group">
                                <span class="input-group-addon">充值系数</span>
                                <input class="form-control" placeholder="充值系数" name="ruleCoff" id="ruleCoff">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group input-group">
                                <span class="input-group-addon">状态</span>
                                <select class="form-control" id="ruleStatus">
                                    <option value="1">启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group input-group">
                                <span class="input-group-addon">创建时间</span>
                                <input class="form-control" placeholder="创建时间" readonly="readonly" name="ruleCreatedDate" id="ruleCreatedDate">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group input-group">
                                <span class="input-group-addon">结束时间</span>
                                <input class="form-control" placeholder="结束时间" name="ruleEndDate" id="ruleEndDate">
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="rechargeManager.operate();">
                    确认
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<!-- system confirm modal start -->
<div id="ycf-alert" class="modal">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span
                        class="sr-only">Close</span></button>
                <h5 class="modal-title"><i class="fa fa-exclamation-circle"></i> [Title]</h5>
            </div>
            <div class="modal-body">
                <p>[Message]</p>
            </div>
            <div class="modal-footer">
                <center>
                    <button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>
                    <button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>
                </center>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="../commons/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../commons/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="../commons/bootstrap/table/bootstrap-table.min.js"></script>
<script type="text/javascript" src="../commons/bootstrap/table/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="../commons/validate/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="../commons/confirm/bootstrap.confirm.js"></script>
<script type="text/javascript" src="../commons/toastr/toastr.min.js"></script>
<script type="text/javascript" src="../commons/laydate/laydate.js"></script>
<script type="text/javascript" src="rechargeRuleApi.js"></script>
<script type="text/javascript">
    laydate.render({
        elem: '#searchStartTime',
        type: 'date',
        done:function () {
            var a = $("#searchStartTime").val();
            var b = $("#searchEndTime").val();
            if (new Date(a) > new Date(b)){
                toastr['error']("开始时间必须小于结束时间");
                $("#searchStartTime").val("");
            }
        }
    })
    laydate.render({
        elem: '#searchEndTime',
        type: 'date',
        done:function () {
            var a = $("#searchStartTime").val();
            var b = $("#searchEndTime").val();
            if (new Date(a) > new Date(b)){
                toastr['error']("开始时间必须小于结束时间");
                $("#searchEndTime").val("");
            }
        }
    })
    laydate.render({
        elem: '#ruleEndDate',
        type: 'date'
    })
</script>
</html>